package controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class ElegirAccionController {

	@RequestMapping(value="public/elegirAccion", method = RequestMethod.GET)
	public ModelAndView home(@RequestParam String accion){
		ModelAndView mv = new ModelAndView();

		if(accion.equals("alta"))
		{
			System.out.println("ENTRE A ALTA");
			mv.setViewName("alta");
		}
		if(accion.equals("baja"))
		{
			System.out.println("ENTRE A BAJA");
			mv.setViewName("baja");
		}
		if(accion.equals("modificacion"))
		{
			System.out.println("ENTRE A MODIFICACION");
			mv.setViewName("modificacion");
		}
		if(accion.equals("buscar"))
		{
			System.out.println("ENTRE A BUSCAR");
			mv.setViewName("buscar");
		}	
		return mv;
	}
}
